/*
 * PassVector.h
 *  Created on: Oct 11, 2014
 *      Authors: Avihay Avitan & Stefan Farcas
 */

#ifndef PASSVECTOR_H_
#define PASSVECTOR_H_
#include "../Satellite/SatelliteAERQueue.h"
#include "../Satellite/CommandsQueue.h"
#include "../Satellite/Access.h"
#include "../Satellite/SatelliteUplinkCommand.h"
#include "TimeStampUtils.h"
#include "../GSLogger/Logger.h"
#include <queue>

using namespace std;
using namespace SatelliteNameSpace ;
using namespace LoggerNameSpace;

namespace PassVectorSpace {


/**
 * PassVector is a class that models the information needed to a single pass process with a satellite.
 * it contains the commands queue that need to be sent to a satellite, the Satellite AER queue that defines the path that the satellite is going throw, and should be used by the tracker and the Access information given by the prediction model
 * it provides the ability to get and store all information needed.
 */
class PassVector {


public:
	PassVector (SatelliteAER staringPassInstance) ;
	PassVector () ;
	virtual ~PassVector () ;
	long getPassStartTime();
	long getPassStartTrackingTime();
	void addInstance(SatelliteAER instance);
	SatelliteAER * popNextInstance();
	SatelliteAER * getTopInstance();
	int getCountOfInstances();
	bool hasNextInstance();
	void setAccess(Access access);
	Access getAccess();
	void setSatId(string satId);
	string getSatId();
	bool addUplinkCommand(SatelliteUplinkCommand * command);
	SatelliteUplinkCommand * popNextCommand();
	SatelliteUplinkCommand * getTopCommand();
	int getCountOfCommands();
	bool hasNextCommand();
	SatelliteAERQueue getAERQueue();
	void updateStartingPassInstance(long timeStamp);
	void logPassDetailes();

private:
	CommandsQueue commandsQ;
	SatelliteAERQueue aerQueue;
	SatelliteAER * startingPassInstance;
	void updateStartingPassInstance();
	Logger * logger;
	Access access;
	string satId;
} ;

} /* namespace PassVector */

#endif /* PASSVECTOR_H_ */
